package modifyx

type IRoot interface {
	IObject

	RefClassId() string
	// Kind/Id
	RefClassKey() string
	RefClassCatalog() string
	RefClassType() string
	RefDispose()
	// 设置修正的默认的上下文
	// 如果运行时需要指定的上下文，可通过 RefSource直接操作数据源
	RefSetContext(ctx interface{})
	RefSource() *Source
}

type IObject interface {
	RefOrigin(field string) interface{}
	RefInt(field string) (val int)
	RefUint(field string) (val uint)
	RefFloat64(field string) (val float64)
	RefString(field string) (val string)
	RefBool(field string) (val bool)
	RefMap(field string) (r IObject)
	RefObject(field string) (r IObject)
	RefArray(field string) (r IArray)
	RefIsNil() bool
	RefKeys() (r []string)
	RefLength() int
	RefClassCreator(field string, creator func(object IObject) IObject)
	RefAnyType() string
}

type IArray interface {
	RefInt(index int) (val int)
	RefUint(index int) (val uint)
	RefFloat64(index int) (val float64)
	RefString(index int) (val string)
	RefBool(index int) (val bool)
	RefObject(index int) (r IObject)
	RefLength() int
}
